gh-143990: Do not assume the requested font size in test_font#153322
Merged
serhiy-storchaka merged 1 commit intoJul 8, 2026
Merged
Conversation
On platforms with only bitmap fonts Tk substitutes the nearest available size, so query the resolved size instead of assuming it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
Hi, I also noticed this issue shown on the Alpine buildbot, and reproduced it locally. I've verified your fix works as well — using |
Member
Author
|
Thank you for verification. The test was incorrect from the beginning, it should not have such assumption. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On platforms that provide only bitmap fonts (for example the AMD64 Alpine Linux buildbot) a font created from a description such as
('Times', 20, 'bold')does not keep the requested size: Tk substitutes the nearest available size. Thetest_createandtest_existingtests added in GH-152025 asserted the exact requested size (20) and therefore failed there.This asks Tk for the size it actually resolves for the description (via
font actual) instead of assuming the requested value. The keyword/explicit-size assertions are unchanged, since those set the size directly.🤖 Generated with Claude Code